feat(analyze): implement noInlineStyles#9534
Conversation
🦋 Changeset detectedLatest commit: b487334 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (1)
WalkthroughAdds a patch-level changeset Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment Tip You can customize the high-level summary generated by CodeRabbit.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.changeset/strong-mirrors-attend.md (1)
5-5: Consider adding an inline code example of invalid usage.As per coding guidelines, changesets for new lint rules should include an example of an invalid case.
📝 Suggested addition
-Added the nursery rule [`noInlineStyles`](https://biomejs.dev/linter/rules/no-inline-styles/). The rule disallows the use of inline `style` attributes in HTML and the `style` prop in JSX, including `React.createElement` calls. Inline styles make code harder to maintain and can interfere with Content Security Policy. +Added the nursery rule [`noInlineStyles`](https://biomejs.dev/linter/rules/no-inline-styles/). The rule disallows the use of inline `style` attributes in HTML and the `style` prop in JSX, including `React.createElement` calls. Inline styles make code harder to maintain and can interfere with Content Security Policy. + +```jsx +// Invalid +<div style={{ color: "red" }}>Error</div> +```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/strong-mirrors-attend.md at line 5, Add an invalid usage example to the changeset: update .changeset/strong-mirrors-attend.md to include a fenced code block labeled "jsx" that shows an inline style being used (e.g., a JSX element with a style prop like a div using style={{ color: "red" }}) and mark it as "// Invalid" so readers see a concrete disallowed example for the new noInlineStyles rule.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/biome_js_analyze/src/lint/nursery/no_inline_styles.rs`:
- Around line 82-86: The branch handling NoInlineStylesQuery::JsCallExpression
currently constructs NoInlineStylesState::JsxAttribute for React.createElement
calls; change it to use the ReactProp variant instead: in the JsCallExpression
arm (where you call ctx.model() and find_style_attribute(call_expression,
model)?), detect that the call_expression is a React.createElement invocation
and return NoInlineStylesState::ReactProp(property_member.range()) rather than
JsxAttribute(property_member.range()); keep using find_style_attribute and the
existing property_member.range() to locate the node but switch the variant to
ReactProp so createElement props are classified correctly.
---
Nitpick comments:
In @.changeset/strong-mirrors-attend.md:
- Line 5: Add an invalid usage example to the changeset: update
.changeset/strong-mirrors-attend.md to include a fenced code block labeled "jsx"
that shows an inline style being used (e.g., a JSX element with a style prop
like a div using style={{ color: "red" }}) and mark it as "// Invalid" so
readers see a concrete disallowed example for the new noInlineStyles rule.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d3d69339-5874-4ec8-8464-640b6ce457fd
⛔ Files ignored due to path filters (10)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_configuration/src/generated/linter_options_check.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.html.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (9)
.changeset/strong-mirrors-attend.mdcrates/biome_html_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.htmlcrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.htmlcrates/biome_js_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsxcrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsxcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_inline_styles.rs
Merging this PR will not alter performance
Comparing Footnotes
|
Co-authored-by: MCMXC <16797721+mcmxcdev@users.noreply.github.com>
7d4c009 to
688da2d
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (3)
crates/biome_rule_options/src/no_inline_styles.rs (1)
1-6: Add rustdoc documentation for the options struct.As per coding guidelines, rule options should have inline rustdoc documentation explaining what the options control. Even for an empty struct, a brief description helps.
📝 Suggested fix
use biome_deserialize_macros::{Deserializable, Merge}; use serde::{Deserialize, Serialize}; + +/// Options for the `noInlineStyles` rule. #[derive(Default, Clone, Debug, Deserialize, Deserializable, Merge, Eq, PartialEq, Serialize)] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields, default)] pub struct NoInlineStylesOptions {}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_rule_options/src/no_inline_styles.rs` around lines 1 - 6, Add a rustdoc comment for the NoInlineStylesOptions struct describing what the options control (even if empty) by placing a /// doc comment immediately above the pub struct NoInlineStylesOptions {} definition; reference the struct name NoInlineStylesOptions and briefly explain that these options configure the "no inline styles" rule (e.g., purpose and that there are currently no configurable fields)..changeset/strong-mirrors-attend.md (1)
1-5: Consider adding an invalid code example.Based on learnings, changesets for new lint rules should include an example of an invalid case. A brief JSX snippet would help users quickly understand what the rule catches.
📝 Suggested addition
--- "@biomejs/biome": patch --- Added the nursery rule [`noInlineStyles`](https://biomejs.dev/linter/rules/no-inline-styles/). The rule disallows the use of inline `style` attributes in HTML and the `style` prop in JSX, including `React.createElement` calls. Inline styles make code harder to maintain and can interfere with Content Security Policy. + +```jsx +// Invalid +<div style={{ color: "red" }}>Error</div> +```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/strong-mirrors-attend.md around lines 1 - 5, Add an explicit "Invalid" example to the changeset description for the new nursery rule `noInlineStyles` so users can quickly see what the rule catches; update the `.changeset/strong-mirrors-attend.md` content to include a short JSX snippet under a clear "Invalid" heading (e.g., show a JSX element using the `style` prop such as a `div` with `style={{ color: "red" }}`) and ensure it is fenced as code for readability and consistency with other changesets.crates/biome_js_analyze/src/lint/nursery/no_inline_styles.rs (1)
52-58: Consider addingsourcesmetadata.This rule is ported from html-eslint. As per coding guidelines, rules derived from other linters should use the
sourcesmetadata to attribute the original source.📝 Suggested fix
pub NoInlineStyles { version: "next", name: "noInlineStyles", language: "js", recommended: false, fix_kind: FixKind::Unsafe, + sources: &[RuleSource::EslintHtmlEslint("no-inline-styles")], }You'll also need to import
RuleSourcefrombiome_analyze.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_analyze/src/lint/nursery/no_inline_styles.rs` around lines 52 - 58, The NoInlineStyles rule metadata is missing the required sources attribution; import RuleSource from biome_analyze and add a sources field to the rule initializer (e.g., sources: vec![RuleSource::HtmlEslint]) alongside the existing version/name/language/recommended/fix_kind values to attribute the original html-eslint source.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.changeset/strong-mirrors-attend.md:
- Around line 1-5: Add an explicit "Invalid" example to the changeset
description for the new nursery rule `noInlineStyles` so users can quickly see
what the rule catches; update the `.changeset/strong-mirrors-attend.md` content
to include a short JSX snippet under a clear "Invalid" heading (e.g., show a JSX
element using the `style` prop such as a `div` with `style={{ color: "red" }}`)
and ensure it is fenced as code for readability and consistency with other
changesets.
In `@crates/biome_js_analyze/src/lint/nursery/no_inline_styles.rs`:
- Around line 52-58: The NoInlineStyles rule metadata is missing the required
sources attribution; import RuleSource from biome_analyze and add a sources
field to the rule initializer (e.g., sources: vec![RuleSource::HtmlEslint])
alongside the existing version/name/language/recommended/fix_kind values to
attribute the original html-eslint source.
In `@crates/biome_rule_options/src/no_inline_styles.rs`:
- Around line 1-6: Add a rustdoc comment for the NoInlineStylesOptions struct
describing what the options control (even if empty) by placing a /// doc comment
immediately above the pub struct NoInlineStylesOptions {} definition; reference
the struct name NoInlineStylesOptions and briefly explain that these options
configure the "no inline styles" rule (e.g., purpose and that there are
currently no configurable fields).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 51cba0cc-9c93-4eef-8120-5da716b72b57
⛔ Files ignored due to path filters (10)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_configuration/src/generated/linter_options_check.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.html.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (9)
.changeset/strong-mirrors-attend.mdcrates/biome_html_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.htmlcrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.htmlcrates/biome_js_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsxcrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsxcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_inline_styles.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx
- crates/biome_html_analyze/src/lint/nursery/no_inline_styles.rs
ematipico
left a comment
There was a problem hiding this comment.
This new pr didn't address of my previous comments.
Not enough tests, diagnostics don't follow the rule pillars, docs to adjust
| let node = ctx.query(); | ||
|
|
||
| let name = node.name().ok()?; | ||
| let value_token = name.value_token().ok()?; | ||
| if value_token.text_trimmed().to_lowercase_cow() == "style" { | ||
| return Some(()); | ||
| } | ||
|
|
||
| None |
There was a problem hiding this comment.
We must distinguish between components and normal tags.
Components shouldn't be triggered
| "Avoid using the "<Emphasis>"style"</Emphasis>" attribute. Prefer external CSS classes instead of inline styles." | ||
| }, | ||
| ) | ||
| .note(markup! { | ||
| "Inline styles make code harder to maintain, reduce reusability, and can prevent effective use of a strict Content Security Policy." |
There was a problem hiding this comment.
Let's follow the rule pillars, the exact order:
- error
- why
- solution
Plus, the "Prefer.." phrase goes in conflict with the action
There was a problem hiding this comment.
Tweaked the diagnostic a bit, but unsure about it 🤔
|
I closed the inactive PRs |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
crates/biome_js_analyze/src/react.rs (1)
99-109: Consider scopingis_custom_componenttopub(crate).This helper reads like internal analyser plumbing; keeping it crate-scoped avoids unintentionally expanding the public API surface.
Suggested tweak
- pub fn is_custom_component(&self) -> bool { + pub(crate) fn is_custom_component(&self) -> bool {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_analyze/src/react.rs` around lines 99 - 109, Change the visibility of the helper function is_custom_component from pub to pub(crate) to keep this internal analyser plumbing out of the public API; locate the is_custom_component method on the React node (the function that checks element_type -> as_any_js_expression -> as_any_js_literal_expression -> as_js_string_literal_expression) and make it crate-scoped (pub(crate)) instead of public.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/biome_js_analyze/src/lint/nursery/no_inline_styles.rs`:
- Around line 89-90: The message string "Unexpected
\"<Emphasis>\"style\"</Emphasis>\" attribute." is inaccurate for object member
(React.createElement) hits; update the wording wherever that literal appears
(e.g., the message constant or message construction in no_inline_styles.rs) to
"Unexpected \"<Emphasis>\"style\"</Emphasis>\" attribute or property." so it
covers both DOM attributes and JS object properties; ensure you change every
occurrence (including the second instance corresponding to the other hit) so
messages are consistent.
- Around line 146-153: The loop over props.members() uses the try operator (`?`)
on each step (member.ok()?, as_js_property_object_member()?, name().ok()?,
as_js_literal_member_name()?, value().ok()?) which causes the whole function to
return early when encountering non-property members (spreads/computed), missing
later style props; change those `?` uses to fallible checks that continue the
loop on None/Err (e.g., use if let/let Some(...) or match and continue) so you
only skip the offending member instead of exiting the function, and keep the
early return only when is_style_value(&value) is true (return
Some(property_member.clone())).
---
Nitpick comments:
In `@crates/biome_js_analyze/src/react.rs`:
- Around line 99-109: Change the visibility of the helper function
is_custom_component from pub to pub(crate) to keep this internal analyser
plumbing out of the public API; locate the is_custom_component method on the
React node (the function that checks element_type -> as_any_js_expression ->
as_any_js_literal_expression -> as_js_string_literal_expression) and make it
crate-scoped (pub(crate)) instead of public.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d613f9e8-00aa-4535-801a-5715cd310882
⛔ Files ignored due to path filters (10)
crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/invalid.astro.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/valid.astro.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/invalid.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/valid.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/valid.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (13)
crates/biome_html_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/invalid.astrocrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/valid.astrocrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.htmlcrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/invalid.sveltecrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/valid.sveltecrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.htmlcrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/invalid.vuecrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/valid.vuecrates/biome_js_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_js_analyze/src/react.rscrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsxcrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsx
| "Unexpected "<Emphasis>"style"</Emphasis>" attribute." | ||
| }, |
There was a problem hiding this comment.
Message wording is inaccurate for React.createElement cases.
When the hit is an object member, “attribute” is misleading; “attribute or property” would match both paths.
Also applies to: 118-118
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@crates/biome_js_analyze/src/lint/nursery/no_inline_styles.rs` around lines 89
- 90, The message string "Unexpected \"<Emphasis>\"style\"</Emphasis>\"
attribute." is inaccurate for object member (React.createElement) hits; update
the wording wherever that literal appears (e.g., the message constant or message
construction in no_inline_styles.rs) to "Unexpected
\"<Emphasis>\"style\"</Emphasis>\" attribute or property." so it covers both DOM
attributes and JS object properties; ensure you change every occurrence
(including the second instance corresponding to the other hit) so messages are
consistent.
b463e46 to
9d0a07e
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/biome_html_analyze/src/lint/nursery/no_inline_styles.rs (1)
116-119: Consider using?instead ofunwrap()for defensive coding.While
action()is only invoked afterrun()returnsSome, theunwrap()calls assume the attribute still exists. Using?would be more defensive against potential AST inconsistencies.🛡️ Proposed fix
match node { AnyHtmlElement::HtmlElement(element) => { let opening = element.opening_element().ok()?; - mutation.remove_node(find_style_attribute(opening.attributes()).unwrap()) + mutation.remove_node(find_style_attribute(opening.attributes())?) } - AnyHtmlElement::HtmlSelfClosingElement(self_closing_element) => mutation - .remove_node(find_style_attribute(self_closing_element.attributes()).unwrap()), + AnyHtmlElement::HtmlSelfClosingElement(self_closing_element) => { + mutation.remove_node(find_style_attribute(self_closing_element.attributes())?) + } _ => {} }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_html_analyze/src/lint/nursery/no_inline_styles.rs` around lines 116 - 119, The code currently force-unwraps the optional attribute via find_style_attribute(...).unwrap() inside the AnyHtmlElement arms (HtmlElement and HtmlSelfClosingElement), which can panic if the AST changed; replace those unwrap() calls with the ? operator so the action() helper propagates None instead of panicking. Concretely, change mutation.remove_node(find_style_attribute(opening.attributes()).unwrap()) and the self-closing variant to mutation.remove_node(find_style_attribute(...)?), and ensure the enclosing action() function signature and return type allow propagation (i.e., return Option or Result as appropriate) so the ? compiles.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/biome_html_analyze/src/lint/nursery/no_inline_styles.rs`:
- Around line 116-119: The code currently force-unwraps the optional attribute
via find_style_attribute(...).unwrap() inside the AnyHtmlElement arms
(HtmlElement and HtmlSelfClosingElement), which can panic if the AST changed;
replace those unwrap() calls with the ? operator so the action() helper
propagates None instead of panicking. Concretely, change
mutation.remove_node(find_style_attribute(opening.attributes()).unwrap()) and
the self-closing variant to mutation.remove_node(find_style_attribute(...)?),
and ensure the enclosing action() function signature and return type allow
propagation (i.e., return Option or Result as appropriate) so the ? compiles.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5fcd218b-f0e9-4a40-a14e-8f8fdd186e3f
⛔ Files ignored due to path filters (10)
crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/invalid.astro.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/valid.astro.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/invalid.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/valid.svelte.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/invalid.vue.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/valid.vue.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (13)
crates/biome_html_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/invalid.astrocrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/valid.astrocrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/invalid.htmlcrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/invalid.sveltecrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/valid.sveltecrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/valid.htmlcrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/invalid.vuecrates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/valid.vuecrates/biome_js_analyze/src/lint/nursery/no_inline_styles.rscrates/biome_js_analyze/src/react.rscrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/invalid.jsxcrates/biome_js_analyze/tests/specs/nursery/noInlineStyles/valid.jsx
🚧 Files skipped from review as they are similar to previous changes (4)
- crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/svelte/valid.svelte
- crates/biome_js_analyze/src/react.rs
- crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/vue/valid.vue
- crates/biome_html_analyze/tests/specs/nursery/noInlineStyles/astro/invalid.astro
ematipico
left a comment
There was a problem hiding this comment.
Thank you! Merge whenever you want
Summary
Added the nursery rule
NoInlineStyleswhich disallows the usage ofstyleprop in HTML and JSX files.Closes #9062
In favour of #9319 & #9146 (inactive)
Test Plan
Unit tests
Docs